import os, sys, time
from glob import glob

env = Environment()
if ARGUMENTS.get('release', '0') == '1':
    env.Append(CPPFLAGS = ['-O3', '-g3', '-std=c++0x'])
    ver_type = "release"
else:
    env.Append(CPPFLAGS = ['-O0', '-g3', '-std=c++0x'])
    ver_type = 'debug'

pkg_name = 'web'

CPP_DEFINES={
    'NDEBUG' : 1, 'THREADED' : '1',
}

env.Append(CPPPATH = ['../', '/usr/local/include',])
env.Append(CPPDEFINES=CPP_DEFINES)

env.Append(LIBS=['pthread', 'protobuf', 'glog', 'gflags', 'tcmalloc', 'rt' ])
    
source_files = \
     glob('../base/*.cc')  + \
     glob('../net/*.cc')  + \
     glob('../net/module/*.cc') + \
     ['test_poll.cc', 'test_buffer.cc']


print("souce code list: >>")
for s in source_files:
    print os.path.realpath(s)
print('')

env.Program(pkg_name, source_files)
